<?php
class Zendvn_View_Helper_UpDown extends Zend_View_Helper_Abstract {
	
	//$this->formRadio($name,$value,$attribs,$options, $listep);
	/*$attribs = array(
					'icon'=>'icon-32-delete.png',
					'iconDir'=>'images/toolbar/',
				)*/
	//$options = array('type'=>'submit','name'=>'appForm');
	public function upDown($orderGroupArr = array(),$parents = null,$lft = null,$link = '#') {
		
		
		$xhtml = '<div class="up-down">';
		if(isset($orderGroupArr[$parents][$lft])){
			$tmp = $orderGroupArr[$parents][$lft];		
			
			if($tmp > 0 ){
				$link = $link . '/move/up';
				$xhtml .= '<span>
								<a href="'. $link . '" title="Move Up">
									<span class="uparrow">
										
									</span>
								</a>
							</span>';
			}		
			if($tmp < (count($orderGroupArr[$parents])-1)){
				$link = $link . '/move/down';
				$xhtml .= '<span>
								<a href="'. $link . '" title="Move Down">
									<span class="downarrow">
										
									</span>
								</a>
							</span>';
			}
		}
		$xhtml .= '</div><div class="clr"></div>';
		return $xhtml;
	}
}